#include <cstdlib>
#include <stdio.h>
#include <iostream>la
#include<queue>
using namespace std;

template<typename T1>
T1 find_max(T1 *a,T1 n)
{
	int j=0;
	for(int i=1;i<n;i++)
		if(a[i]>a[j])
			j=i;
		return a[j];
}

template<typename T2>
T2 find_min(T2 *a,T2 n)
{
	int j=0;
	for(int i=1;i<n;i++)
		if(a[i]<a[j])
			j=i;
		return a[j];
}

template<typename T3>
T3 find_mean(T3 *a,T3 n)
{
	T3 sum=0,mean;
	for(int i=0;i<n;i++)
	{
		sum=sum+a[i];
	}
	mean=sum/n;
	return  mean;
}

int main()
{
	int a[]={5,6,4,58,2};
	double b[]={2.3,1.1,2.2,3.3,88.01};
	cout << "a_max=" << find_max(a,5) << "\n";
	cout << "b_min=" << find_min(b,5.0) << "\n";
	cout << "a_mean=" << find_mean(a,5) << "\n";
	return 0;
}

